<%--
  Created by IntelliJ IDEA.
  User: 邹敦宇
  Date: 2021/2/26
  Time: 10:39
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>后台管理主页</title>
    <%
        String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/";
    %>
<%--    <base href="<%=basePath%>">--%>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/layui/css/layui.css">
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo">layui 后台布局</div>
        <!-- 头部区域（可配合layui已有的水平导航） -->
        <ul class="layui-nav layui-layout-left">
            <li class="layui-nav-item"><a href="">控制台</a></li>
            <li class="layui-nav-item"><a href="">商品管理</a></li>
            <li class="layui-nav-item"><a href="">用户</a></li>
            <li class="layui-nav-item">
                <a href="javascript:;">其它系统</a>
                <dl class="layui-nav-child">
                    <dd><a href="">邮件管理</a></dd>
                    <dd><a href="">消息管理</a></dd>
                    <dd><a href="">授权管理</a></dd>
                </dl>
            </li>
        </ul>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a href="javascript:;">
                    <img src="/eshop/Img.do?m=showImg&name=${sessionScope.User.imgUrl}" class="layui-nav-img">
                    ${sessionScope.User.username}
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="">基本资料</a></dd>
                    <dd><a href="">安全设置</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item"><a href="/eshop/Users.do?m=logout&s=admin">退了</a></li>
        </ul>
    </div>

    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree"  lay-filter="test">
                <li class="layui-nav-item layui-nav-itemed">
                    <a class="" href="javascript:;">后台管理</a>
                    <dl class="layui-nav-child" id="menu">
                        <dd><a href="javascript:;" data-url="/eshop/admin/user-list.jsp">用户管理</a></dd>
                        <dd><a href="javascript:;" data-url="/eshop/admin/marquee-list.jsp">轮播图管理</a></dd>
                        <dd><a href="javascript:;" data-url="/eshop/admin/brand-list.jsp">品牌管理</a></dd>
                        <dd><a href="javascript:;" data-url="/eshop/admin/productType-list.jsp">商品类型管理</a></dd>
                        <dd><a href="javascript:;" data-url="/eshop/admin/product-list.jsp">商品管理</a></dd>
                        <dd><a href="">超链接</a></dd>
                    </dl>
                </li>
            </ul>
        </div>
    </div>

    <div class="layui-body">
        <!-- 内容主体区域 -->
        <div style="padding: 15px;" id="content">内容主体区域</div>
    </div>

    <div class="layui-footer">
        <!-- 底部固定区域 -->
        © layui.com - 底部固定区域
    </div>
</div>
<script src="${pageContext.request.contextPath}/static/layui/layui.js"></script>
<script>
    //JavaScript代码区域
    layui.use('element', function(){
        var element = layui.element;
        var $ = layui.$;//通过layui获取到jquery
        $("#menu>dd").click(function () {
            //获取到a标签中的data-url属性
            let dataUrl = $(this).find("a").attr("data-url");
            console.log(dataUrl);
            $("#content").empty()
            $("#content").load(dataUrl);
        })
    });
</script>
</body>
</html>
